<!-- 目录 -->
<template>
    <div class="routeLi" v-for="(item) in routerList">
        <RouterLink :to="(item.path as string)">跳转到{{ item.name }}</RouterLink>
    </div>
</template>

<script setup lang="ts">
    import { ref, reactive, onMounted, Ref, getCurrentInstance } from "vue";
    // 获取路由
    import { useRouter, useRoute } from 'vue-router'
    // 路由列表
    const router = ref(useRouter().getRoutes());
    const routerList = router.value.filter((route)=>{
        return (route.name != '' && route.name != 'main')
    })
    
    onMounted(()=>{  })
</script>
<style scoped lang="less">
    .routeLi {
        height: 30px;
        line-height: 30px;
        &:nth-last-child(2n) {
            background-color: aquamarine;
        }
    }

</style>